/*
 * @Author: Allan
 * @Date: 2022-05-11 20:23:22
 * @LastEditors: Allan
 * @LastEditTime: 2022-05-18 11:19:14
 * @FilePath: \studygo\defer面试题.go
 * @Description: 
 * 
 * Copyright (c) 2022 by Allan / ganger@whut.edu.cn, All Rights Reserved. 
 */
package main

import "fmt"

func calc(index string, a, b int) int {
	ret := a + b
	fmt.Println(index, a, b, ret)
	return ret
}

func D2main() {
	x := 1
	y := 2
	defer calc("AA", x, calc("A", x, y))
	x = 10
	defer calc("BB", x, calc("B", x, y))
	y = 20
}
